<?php
/**
 * ucfirst UTF-8 aware function
 *
 * @param string $string
 * @return string
 * @see http://ca.php.net/ucfirst
 * @author mattalexxpub at gmail dot com
 */
if (!function_exists('mb_ucfirst')) {
    function mb_ucfirst($string, $e ='utf-8') {
    	
    	if (null === $string) {
    		return null;
    	}
    	
    	if (false === $string) {
    		return false;
    	}
    	
        if (function_exists('mb_strtoupper') && function_exists('mb_substr') && !empty($string)) {
            $string = mb_strtolower($string, $e);
            $upper = mb_strtoupper($string, $e);
            preg_match('#(.)#us', $upper, $matches);
            $string = $matches[1] . mb_substr($string, 1, mb_strlen($string, $e), $e);
        } else {
            $string = ucfirst($string);
        }
        return $string;
    } 
}

/**
 * Fire Bug logs writer
 * 
 * @param $message message to write
 * @param $label label for log block
 * @return void
 */
function fb($message, $label = null)
{
    if ($label!=null) {
        $message = array($label,$message);
    }

    Zend_Registry::get('log')->debug($message);
}